<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户管理</title>
    <link rel="shortcut icon" th:href="@{../../pages/img/logo.jpg.ico}" />
    <link th:href="@{../css/public.css}" type="text/css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <!-- jQuery文件，务必在bootstrap.min.js 之前引入 -->

    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->

    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>

</head>
<body>

<div th:replace="public.html::上方导航"></div>
<div class="dbys">
    <div th:replace="public.html::左导航栏"></div>
</div>
<div id="操作界面">

    <form th:action="@{/admin/userByName}" th:method="get" class="cx">
        <input th:name="uName" class="input-medium search-query" placeholder="用户名" type="text"/>
        <button type="submit" class="btn btn-info">查找</button>
        <a type="button" class="btn btn-success" th:href="@{/admin/adduser}">增加</a>
    </form>
    <p>
    </p>

    <table class="table bg">
        <thead>
        <tr>
            <th>用户id</th>
            <th>用户名称</th>
            <th>用户性别</th>
            <th>用户手机号</th>
            <th>用户账号</th>
            <th>用户密码</th>


        </tr>
        </thead>
        <tbody>
        <tr th:each="user:${page.getPage().getRecords()}" class="success">
            <td th:text="${user.getUId()}"></td>
            <td th:text="${user.getUName()}"></td>
            <td th:text="${user.getUSex()}"></td>
            <td th:text="${user.getUPhoneNum()}"></td>
            <td th:text="${user.getUUsername()}"></td>
            <td th:text="${user.getUPassword()}"></td>
            <td>
                <a th:href="@{|/admin/toUpdateUser/${user.getUId()}|}" th:name="uId" type="button"
                   class="btn btn-warning">修改</a>
                <a th:href="@{|/admin/deleteUser/${user.getUId()}|}" th:name="uId" type="btn btn-danger"
                   class="btn btn-danger" onclick="var toDelete = (confirm('确定要删除这个用户吗?')); return toDelete ">删除</a>
            </td>
        </tr>
        </tbody>
    </table>
    <nav aria-label="Page navigation" class="csz">
        <ul class="pagination" th:if="${page.getPage().getSize()>0}">
            <li>
                <a th:href="@{${page.getPath()}(currentpage=1)}" aria-label="Previous">
                    <span aria-hidden="true">首页</span>
                </a>
            </li>

            <li th:each="i:${#numbers.sequence(1,page.getPage().getPages())}">
                <a th:href="@{${page.getPath()}(currentpage=${i})}" th:text="${i}"></a>
            </li>

            <li>
                <a th:href="@{${page.getPath()}(currentpage=${page.getPage()})}" aria-label="Previous">
                    <span aria-hidden="true">末页</span>
                </a>
            </li>
        </ul>
    </nav>
</div>
</body>
</html>